package com.wqnmdb.im.domain.resp;


import com.wqnmdb.im.domain.contants.ConstantEnum;
import com.wqnmdb.im.utils.DateUtil;
import lombok.Data;

/**
 * 客户端和服务器通信对象
 *
 * @author zkp
 */
@Data
public class R<T> {
    /**
     * 状态码
     */
    private int code = ConstantEnum.SUCCESS.getCode();

    /**
     * 消息
     */
    private String msg = ConstantEnum.SUCCESS.getContent();

    /**
     * 数据
     */
    private T data;

    private int timestamp = DateUtil.getNowInt();


    public R() {
    }

    public R(T data) {
        this.data = data;
    }

    public R(String msg, T data) {
        this.msg = msg;
        this.data = data;
    }

    public R(int code, String msg, T data) {
        this.code = code;
        this.data = data;
        this.msg = msg;
    }
}

